package com.hiyee.api.controller.user;

import com.hiyee.grace.result.ResponseJsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

@Api(value = "用户管理相关接口", tags = {"用户管理相关接口"})
@RequestMapping("userMng")
public interface AppUserControllerApi {

    /**
     * Api 只定义接口，具体实现由相应的服务层实现
     * 方便微服务的统一调度和管理
     *
     * 本工程的目标就是定义规范、解耦
     *
     * swagger2 基于接口自动文档生成
     *
     * 提高项目可扩展性
     *
     * @return
     */
    @ApiOperation(value = "获取用户列表", notes = "获取用户列表", httpMethod = "GET")
    @GetMapping("/list")
    public ResponseJsonResult getList(@RequestParam String nickname,
                                      @RequestParam Integer status,
                                      @RequestParam Date start_date,
                                      @RequestParam Date end_date,
                                      @RequestParam Integer page,
                                      @RequestParam Integer page_size);
    /**
     * 获取用户信息
     *
     * @return
     */
    @ApiOperation(value = "获取用户信息", notes = "获取用户信息", httpMethod = "GET")
    @GetMapping("/get")
    public ResponseJsonResult get(@RequestParam String userId);

    /**
     * 获取用户信息
     *
     * @return
     */
    @ApiOperation(value = "激活，冻结用户", notes = "激活，冻结用户", httpMethod = "POST")
    @PostMapping("/freeze")
    public ResponseJsonResult freeze(@RequestParam String userId);
}
